package com.xzz;

/**
 * @author 黄会准
 * @since 2020-11-17
 */
public class ParkingSystem {
    int[] container = new int[3];

    public ParkingSystem(int big, int medium, int small) {
        container[0] = big;
        container[1] = medium;
        container[2] = small;
    }

    public boolean addCar(int carType) {
        if(container[carType-1]-1>=0){
            container[carType-1]--;
            return true;
        }
        return false;
    }

    public static void main(String[] args) {
        ParkingSystem obj = new ParkingSystem(1, 2, 3);
        System.out.println(obj.addCar(1));
        System.out.println(obj.addCar(1));
    }
}
